//校验ckAmount
export function ckAmount(Amount){
    let amount=(Amount).toString()
    //先把非数字的都替换掉，除了数字和.
    amount= amount .replace(/[^\d\.]/g,'');
    //必须保证第一个为数字而不是.
    amount = (amount) .replace(/^\./g,'');
    //保证只有出现一个.而没有多个.
    amount= amount .replace(/\.{2,}/g,'.');
    //保证.只出现一次，而不能出现两次以上
    amount = amount.replace('.','$#$').replace(/\./g,'').replace('$#$','.');
    return amount
}
export function ckDesc(Desc){
    return Desc.replace(/(\ud83c[\udf00-\udfff])|(\ud83d[\udc00-\ude4f\ude80-\udeff])|[\u2600-\u2B55]/g, ' ');
}


export function dataNullFilter(appealData,errorMessage,this_){
    this_.iserrordata=false;
    for ( var key in errorMessage) {
        errorMessage[key]=false;
    }
    for ( var key in errorMessage) {
        if(!appealData[key]&&appealData[key]!==0){
            this_.iserrordata=true
            errorMessage[key]=true;
        }
    }
    return  errorMessage;
}
export function dataDescLengthFilter(appealData,exa,errorMessage,this_){
    this_.iserrorDescLength=false;
    for ( var key in exa) {
        exa[key]=false;
    }
    for ( var key in exa) {
        if(errorMessage[key]!=true&&appealData[key]){
            if(appealData[key].length<10){
                this_.iserrorDescLength=true
                exa[key]=true;
            }}
    }
    return  exa;
}



